import 'package:flutter/material.dart';
import 'LoadingDialog.dart';

// ignore: avoid_init_to_null
BuildContext? dialogContext = null;
class KSProgressDialog  {
  //加载框
  void LoadingToast(String content, BuildContext context) {
    dialogContext = context;
    print(context);
    showDialog(
        context: context,
        barrierDismissible: false,
        builder: (BuildContext context) {
          dialogContext = context;
          return new LoadingDialog(
            title: content,
          );
        });
  }

  // 关闭加载框
  void CloseLoading() {
    Navigator.pop(dialogContext!);
  }
}
